<ui:component xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:richx="http://richfaces.org/richx">

	<a4j:keepAlive beanName="selectNaturalPersonExtPartyHelper"/>
	<rich:modalPanel id="selectPartyPanel" width="480" height="400" zindex="10600">
		<f:facet name="header">
			<h:outputText value="Seleccionar persona"/>
		</f:facet>
		<h:form>
			<!-- a4j:region renderRegionOnly="true"-->
				<rich:extendedDataTable id="selectPersonaTable" value="#{selectNaturalPersonExtPartyHelper.dataModel}"
						var="person" rows="10" height="330px" selectionMode="single" enableContextMenu="false"
						selection="#{selectNaturalPersonExtPartyHelper.partySelection}">
					<f:facet name="header">
						<h:outputText value="Filtre por cualquier atributo"/>
					</f:facet>
					<f:facet name="footer">
						<rich:datascroller selectedStyle="font-weight:bold"/>
					</f:facet>
					<rich:column filterBy="#{person.identity}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="Identidad"/>
						</f:facet>
						<h:outputText value="#{person.identity}" />
					</rich:column>
					<rich:column filterBy="#{person.firstName1}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="1er Nombre"/>
						</f:facet>
						<h:outputText value="#{person.firstName1}" />
					</rich:column>
					<rich:column filterBy="#{person.firstName2}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="2do Nombre"/>
						</f:facet>
						<h:outputText value="#{person.firstName2}" />
					</rich:column>
					<rich:column filterBy="#{person.lastName1}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="1er Apellido"/>
						</f:facet>
						<h:outputText value="#{person.lastName1}" />
					</rich:column>
					<rich:column filterBy="#{person.lastName2}" filterEvent="onkeyup">
						<f:facet name="header">
							<h:outputText value="2do Apellido"/>
						</f:facet>
						<h:outputText value="#{person.lastName2}" />
					</rich:column>
				</rich:extendedDataTable>
				<br/>
				<a4j:commandButton id="acceptParty" value="Aceptar"
						actionListener="#{selectNaturalPersonExtPartyHelper.takeSelection}"
						oncomplete="#{rich:component('selectPartyPanel')}.hide()"
						reRender="#{selectNaturalPersonExtPartyHelper.reRenderComponents}">
				</a4j:commandButton>
				<a4j:commandButton value="Cancelar" onclick="#{rich:component('selectPartyPanel')}.hide()"/>
			<!-- /a4j:region-->
		</h:form>
	</rich:modalPanel>

</ui:component>
